package com.yehuishou.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yehuishou.dao.BrandDao;
import com.yehuishou.pojo.Brand;
import com.yehuishou.service.BrandService;


@Service
public class BrandServiceImpl implements BrandService {

	@Resource
	
	private BrandDao brandDao;
	
	@Override
	public List<Brand> getAllBrand(Integer cid) {
		
		return  brandDao.getAllBrand(cid);
	}

	@Override
	public boolean checkBrandExist(Brand brand) {
		Brand brand2 =brandDao.checkBrandExist(brand);
		if(brand2==null) {
			
			return true;
		}else {
		return false;
	}
	
	}

	@Override
	public void addBrand(Brand brand) {
		
		brandDao.addOneBrand(brand);
	}

	@Override
	public void deleteBrandById(Integer pid) {
		brandDao.deleteBrand(pid);
		
	}
}
